﻿using System.ComponentModel.DataAnnotations;
using Orchard.ContentManagement;
using Twitter.Models.Enums;
using Twitter.Extensions;

namespace Twitter.Models
{
    public class TweetButtonPart : ContentPart<TweetButtonPartRecord>
    {
        [Required]
        public string Username
        {
            get { return Record.Username; }
            set { Record.Username = value; }
        }

        public string RelatedUsername
        {
            get { return Record.RelatedUsername; }
            set { Record.RelatedUsername = value; }
        }

        public string RelatedUserDescription
        {
            get { return Record.RelatedUserDescription; }
            set { Record.RelatedUserDescription = value; }
        }

        public string TweetText
        {
            get { return Record.TweetText; }
            set { Record.TweetText = value; }
        }

        public string Url
        {
            get { return Record.Url; }
            set { Record.Url = value; }
        }

        [Required]
        public DataCount DataCount
        {
            get { return Record.DataCount.ToDataCount(); }
            set { Record.DataCount = (int)value; }
        }

        [Required]
        public Language Language
        {
            get { return Record.Language.ToLanguage(); }
            set { Record.Language = (int)value; }
        }
    }
}
